package com.me.test;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * 测试 @ConfigurationProperties 绑定配置类和配置文件的值
 *
 * @author ME
 * @date 2021/1/25
 */
@Component
@ConfigurationProperties(prefix = "com.me")
public class MessageProperties {
    private String name;
    private String say;
    private TokenInterceptorProperties token;

    public static class TokenInterceptorProperties {
        private Boolean enable;

        public Boolean getEnable() {
            return enable;
        }

        public void setEnable(Boolean enable) {
            this.enable = enable;
        }
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSay() {
        return say;
    }

    public void setSay(String say) {
        this.say = say;
    }

    public TokenInterceptorProperties getToken() {
        return token;
    }

    public void setToken(TokenInterceptorProperties token) {
        this.token = token;
    }
}
